package com.ssy.lingxi.system.controller;

import com.ssy.lingxi.common.model.vo.PageVO;
import com.ssy.lingxi.common.response.PageData;
import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.system.dto.request.ContractParamStateRequest;
import com.ssy.lingxi.system.entity.ContractParam;
import com.ssy.lingxi.system.service.IContractParamService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @menu 规则配置 - 电子合同参数配置
 * @author yzc
 * @version 2.0.0
 * @date 2020/8/20
 */
@Api(tags = "规则配置 - 电子合同参数配置")
@RestController
@RequestMapping("/contractParam")
public class ContractParamController {

    @Resource
    private IContractParamService companyService;

    @ApiOperation(value = "电子合同参数配置分页列表")
    @GetMapping("/page")
    public Wrapper<PageData<ContractParam>> pageContractParam(PageVO request) {
        return companyService.pageContractParam(request);
    }

    @ApiOperation(value = "电子合同参数配置停用/启用")
    @PostMapping(value = "/enable")
    public Wrapper updateStatusContractParam(@RequestBody @Validated ContractParamStateRequest request) {
        return companyService.updateStateContractParam(request);
    }

}
